package com.springcloud.controller;

import com.springcloud.pojo.Address;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 咕唧
 * @Date 2022/6/23 16:46
 * @Version 1.0
 */
@RestController
@RequestMapping("/address")
public class AddressController {

    @Value("${server.port}")
    private int port;

    @GetMapping("/info/{id}")
    public Address findById(@PathVariable Long id) {
        Address address=new Address();
        address.setAddressName("地址名字:---"+id+"===="+port);
        address.setId(id);
        address.setPhoneNum("地址的电话:---"+id+"====="+port);
        return address;
    }
}
